//
//  ImaginationThestormModel_Two.m
//  Gxj
//
//  Created by 💋索少杰 on 2017/10/25.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "ImaginationThestormModel_Two.h"

NSString *const nBtormModelThinkid     = @"thinkid";
NSString *const nBtormModelUserid      = @"userid";
NSString *const nBtormModelInfo        = @"info";
NSString *const nBtormModelViewnum     = @"viewnum";
NSString *const nBtormModelCreate_date = @"create_date";
NSString *const nBtormModelIndustryid  = @"industryid";
NSString *const nBtormModelHead_img    = @"head_img";
NSString *const nBtormModelLevel       = @"level";
NSString *const nBtormModelNickname    = @"nickname";
NSString *const nBtormModelImgsrc      = @"imgsrc";
NSString *const nBtormModelBestuser    = @"bestuser";
NSString *const nBtormModelFollow      = @"follow";
NSString *const nBtormModelTitle       = @"title";

@implementation ImaginationThestormModel_Two

@synthesize thinkid     = _thinkid;
@synthesize userid      = _userid;
@synthesize info        = _info;
@synthesize viewnum     = _viewnum;
@synthesize create_date = _create_date;
@synthesize industryid  = _industryid;
@synthesize head_img    = _head_img;
@synthesize level       = _level;
@synthesize nickname    = _nickname;
@synthesize imgsrc      = _imgsrc;
@synthesize bestuser    = _bestuser;
@synthesize follow      = _follow;
@synthesize title       = _title;

+ (instancetype)modelObjectWithDictionary:(NSDictionary *)dict
{
    return [[self alloc] initWithDictionary:dict];
}

- (instancetype)initWithDictionary:(NSDictionary *)dict
{
    self = [super init];
    if (self && [dict isKindOfClass:[NSDictionary class]])
    {
        _thinkid     = [self checkNilObjectForKey:nBtormModelThinkid        fromDictionary:dict];
        _userid      = [self checkNilObjectForKey:nBtormModelUserid         fromDictionary:dict];
        _info        = [self checkNilObjectForKey:nBtormModelInfo           fromDictionary:dict];
        _viewnum     = [self checkNilObjectForKey:nBtormModelViewnum        fromDictionary:dict];
        _create_date = [self checkNilObjectForKey:nBtormModelCreate_date    fromDictionary:dict];
        _industryid  = [self checkNilObjectForKey:nBtormModelIndustryid     fromDictionary:dict];
        _head_img    = [self checkNilObjectForKey:nBtormModelHead_img       fromDictionary:dict];
        _level       = [self checkNilObjectForKey:nBtormModelLevel          fromDictionary:dict];
        _nickname    = [self checkNilObjectForKey:nBtormModelNickname       fromDictionary:dict];
        _imgsrc      = [self checkNilObjectForKey:nBtormModelImgsrc         fromDictionary:dict];
        _bestuser    = [self checkNilObjectForKey:nBtormModelBestuser       fromDictionary:dict];
        _follow      = [self checkNilObjectForKey:nBtormModelFollow         fromDictionary:dict];
        _title       = [self checkNilObjectForKey:nBtormModelTitle          fromDictionary:dict];
    }
    return self;
}
- (NSDictionary *)dictionaryRepresentation
{
    NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary];
    [mutableDict setValue:_thinkid          forKey:nBtormModelThinkid];
    [mutableDict setValue:_userid           forKey:nBtormModelUserid];
    [mutableDict setValue:_info             forKey:nBtormModelInfo];
    [mutableDict setValue:_viewnum          forKey:nBtormModelViewnum];
    [mutableDict setValue:_create_date      forKey:nBtormModelCreate_date];
    [mutableDict setValue:_industryid       forKey:nBtormModelIndustryid];
    [mutableDict setValue:_head_img         forKey:nBtormModelHead_img];
    [mutableDict setValue:_level            forKey:nBtormModelLevel];
    [mutableDict setValue:_nickname         forKey:nBtormModelNickname];
    [mutableDict setValue:_imgsrc           forKey:nBtormModelImgsrc];
    [mutableDict setValue:_bestuser         forKey:nBtormModelBestuser];
    [mutableDict setValue:_follow           forKey:nBtormModelFollow];
    [mutableDict setValue:_title            forKey:nBtormModelTitle];
    
    return [NSDictionary dictionaryWithDictionary:mutableDict];
}
- (id)checkNilObjectForKey:(id)key fromDictionary:(NSDictionary *)dict
{
    id object = [dict objectForKey:key];
    return [object isKindOfClass:[NSNull class]] ? nil : object;
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@",[self dictionaryRepresentation]];
}

@end
